package com.zttek.videoShareProject.modules.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.zttek.videoShareProject.common.json.VideoVO;
import com.zttek.videoShareProject.modules.model.Video;
import com.baomidou.mybatisplus.service.IService;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author CBY
 * @since 2018-07-03
 */
public interface IVideoService extends IService<Video> {

    /**
     * 一次返回3条最新视频数据
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.RecentThreeVideo> showRecentVideo() throws Exception;

    /**
     * 一次返回1条最新视频数据
     *
     * @return
     * @throws Exception
     */
    public VideoVO.OneVideo showOneVideo(Long videoid,Long userid) throws Exception;

    /**
     * 返回12个热门上升视频数据
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.HotVideo> showHotVideo() throws Exception;

    /**
     * 一次返回4*4条视频数据
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.ShowByVideoType> returnByType(Integer pageNum,String videotype) throws Exception;

    /**
     * 搜索返回2*4条视频数据
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.SearchVideo> SearchVideo(Integer pageNum,String search,String videotype) throws Exception;

    /**
     * 返回用户的视频数据
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.UserVideo> UserVideo(Integer pageNum,Long userid) throws Exception;

    /**
     * 返回关注的全部用户的视频数据，按上传时间排序
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.FollowVideo> FollowVideo(Integer pageNum,Long userid) throws Exception;

    /**
     * 返回用户观看过的20个历史视频数据，按观看时间排序
     *
     * @return
     * @throws Exception
     */
    public List<VideoVO.HistoryVideo> HistoryVideo(Long userid) throws Exception;

    /**
     * 上传视频
     *
     * @return
     * @throws Exception
     */
    public Video uploadVideo(VideoVO.UploadVideo uploadVideo) throws Exception;

    /**
     * 举报操作
     * @param ID
     * @return
     */
    public boolean invalid(Long ID);

    /**
     * 更新历史记录
     *
     * @return
     * @throws Exception
     */
    public boolean updateHistory(Long userid,Long videoid) throws Exception;
    public Page<Video> getVideoList(String name,int status);
}
